package com.lengxf.pay.common;

import cn.hutool.core.map.MapUtil;
import com.lengxf.pay.common.config.GlobalObjectMapper;

import java.util.Map;

public class MapConvert {

    public static Map<String, Object> deepMapToJson(Map<String, Object> map) {
        return MapUtil.edit(map, e -> {
            Object value = e.getValue();
            if (value instanceof Map<?, ?>) {
                e.setValue(GlobalObjectMapper.beanToJson(value));
            }
            return e;
        });
    }

}
